package com.ruoyi.common.utils;

import java.util.List;

public class PageUtil {
    public static <T> List<T> pageList(List<T> list, long pageSize, long pageNum) {
        int startIndex = (int) ((pageNum - 1) * pageSize);
        int endIndex = (int) Math.min(startIndex + pageSize, list.size());
        List<T> pageList = list.subList(startIndex, endIndex);
        return pageList;
    }
}
